import  { AppPostT } from '@/utils/request'
import { BannerSearch, Banner } from '@/models/banner'

// 获得banner列表
export async function getBanners() {
    const res = await AppPostT<Banner[]>("/banner/list")
    console.log("getBanners request:", {}, ", result:", res)
    return res.data ? res.data : [] as Banner[]
}

// 获得用户中心banner列表
export async function getUserBanners(data: BannerSearch) {
    const res = await AppPostT<Banner[]>("/banner/user/list", data)
    console.log("getUserBanners request:", data, ", result:", res)
    return res.data ? res.data : [] as Banner[]
}